#ifndef NNE_MEM_MEM_SWITCH_H_
#define NNE_MEM_MEM_SWITCH_H_

#include <map>
#include <memory>
#include "type.h"
#include "util.h"
#include "mem_if.h"

struct Meminfo{
    Meminfo(std::shared_ptr<MemInterface> mem, u64 length, u64 start_add_addr):
        memory(mem), addr_length(length), real_start_addr(start_add_addr)
    {}
    const std::shared_ptr<MemInterface> memory;
    const u64 addr_length;
    const u64 real_start_addr;
};

class NNE50v2MemSwitch : public MemInterface{
public:
    using RamMapType = std::map<u64, Meminfo>;
    NNE50v2MemSwitch(RamMapType rams);
    void write_mem(u64 dst, void* src, u64 length);
    void read_mem(void*dst, u64 src, u64 length);
    ~NNE50v2MemSwitch(){};
private:
    const RamMapType RamMap;
};



#endif
